package cn.ipanel.bigdata.boot.source

import cn.ipanel.bigdata.boot.config.Configuration
import org.apache.spark.sql.Dataset

/**
 * Author: lzz
 * Date: 2021/11/19 9:24
 */
trait Db {

  protected lazy final val database = Configuration.getDatabase(getDBName)
  protected lazy final val protocol = Configuration.getProtocol(database.protocol)

  def getDBName: String

  override def toString: String = s"$getDBName@${Integer.toHexString(hashCode)}"

}